<template>
  <view @click="clickHandler">
    <text :class="'icon iconfont ' + [name]" :style="'font-size:' + size + '; color:' + color"></text>
  </view>
</template>

<script lang="ts">
  import {
    Component,
    Prop,
    Vue
  } from 'vue-property-decorator'

  @Component({})
  export default class MIcon extends Vue {
    @Prop({
      type: String,
    })
    name: string;
    @Prop({
      type: String,
      default: '16px'
    })
    size: string;
    @Prop()
    color: string = "";

    externalClasses = ["icon"];

    clickHandler() {
      this.$emit("click", {});
    }
  }
</script>

<style lang="scss">
  @import "@/assets/styles/font/iconfont.scss";
</style>